<!--
  @author heguanghua
  @since 2019/06/12 19:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'id', hide:true}">Id</th>
        <th lay-data="{field:'plat', unresize:true, align:'center'}">服务平台</th>
        <th lay-data="{field:'servCategName', width:150, unresize:true, align:'center'}">服务分类</th>
        <th lay-data="{field:'stock', unresize:false, align:'center'}">库存量</th>
        <th lay-data="{field:'coefficient', unresize:false, align:'center', edit:'text'}">节假日系数</th>
        <th lay-data="{field:'status', unresize:false, align:'center'}">状态</th>
        <th lay-data="{field:'updateTime', unresize:true, align:'center'}">最近修改人/时间</th>
        <th lay-data="{field:'操作',width:200, unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>

    <tbody>
    <tr th:each="item:${items}">
        <td></td>
        <td th:text="${item.id}">Id</td>
        <td th:text="${T(com.zmn.common.constant.GlobalConsts).getPlatName(item.plat)}" class="layui-gray">plat</td>
        <td th:text="${item.servCategName}" class="">servCategName</td>
        <td th:text="${item.stock == -1 ? '-' : item.stock}" class="layui-gray">stock</td>
        <td th:text="${item.coefficient}" class="layui-gray">coefficient</td>
        <td>
            <input type="checkbox" name="status" id="status"
                   th:key="${item.id}"
                   th:value="${item.status}"
                   lay-text="ON|OFF"
                   lay-skin="switch"
                   lay-filter="chk_status"
                   th:checked="${item.status == 2}" th:disabled="${#authPermit.checkPermit('/plat/orderStock/updateStatus.action') ? false : true}"/>
        </td>
        <td th:text="${(item.updater != null ? item.updater+'/' : '')+T(com.zmn.common.utils.date.DateUtil).toString(item.updateTime)}">updateTime</td>
        <td>
            <a th:if="${#authPermit.checkPermit('/plat/orderStock/update.action')}"  lay-text="修改库存" style="color: #00a0e9" lay-event="updateStock">修改库存</a>
        </td>
    </tr>
    </tbody>
</table>
